package com.tangfuzhong.test;

import com.tangfuzhong.service.BookService;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.tangfuzhong.config.Config09_TX_Transaction;
import com.tangfuzhong.service.UserService;

/**
 * tangfuzhong
 * 动态数据源验证调试
 * 详细说明参见：
 * @see com.tangfuzhong.config.Config09_TX_Transaction
 */
public class IOCTest_09_TX_Transaction {
	
	@Test
	public void test01(){
		System.out.println("IOCTest_Tx事务测试");
		AnnotationConfigApplicationContext applicationContext = 
				new AnnotationConfigApplicationContext(Config09_TX_Transaction.class);
	
		UserService userService = applicationContext.getBean(UserService.class);
		BookService bookService = applicationContext.getBean(BookService.class);

		userService.insertUser();
		applicationContext.close();
	}

}
